<?php
	$valstring='
		$var = "123";
		$var1=900;
		//测试
		$var3[222]*=1;
		$var3=$var3[222]*1;
		$var4=$var3+var1;
		/*
		测试
		*/
		/*test*/
		$var33=$var33[222];
		echo $var4,$var,$var3;
		
		function funtest($var3, $var4){
			return $var3+var4;
		}
		
		echo funtest(1,2);
		
		funtest (22,ss);
		
		function funtest2 ($var3,$var4){}
		
	';
	preg_match_all('/\W*(\$[\w]+)[^A-Za-z0-9_]*/', $valstring, $result);
	print_r($result);

	$varname='$var3';
	while(strpos($valstring,$varname)){
		$valstring = preg_replace('/\\'.$varname.'(\W*)/', '$varvars\1', $valstring);	
	}
	
	$funname='funtest2';
	while(preg_match('/'.$funname.'\s*\(/', $valstring)){
		$valstring = preg_replace('/'.$funname.'\s*\((\W*)/', 'funtest99(\1', $valstring);	
	}

	echo $valstring;
	
						$valstring = preg_replace('/\s+\/\/[^\n]*|\/\*([^\*^\/]*|[\*^\/*]*|[^\**\/]*)*\*\//', '', $valstring);
						$valstring = str_replace("\n", " ", $valstring);
						
						echo $valstring;
?>